﻿package
{
	public class User
	{
		//basic user information
		private var mUserName:String;
		private var mUserPic:String;
		private var mUserID:String;
		//user game stats
		private var mRank:int = 0;
		private var mST:int = 0;
		private var mFL:int = 0;
		private var mFH:int = 0;
		private var mFK:int = 0;
		private var mSF:int = 0;
		private var mDR:int = 0;
		
		public function User(inName:String, inPic:String, inID:String)
		{
			if(inName == null)
			{
				inName = "SomeOne";
			}
			if(inPic == null)
			{
				inPic = "Picture";
			}
			if(inID == null)
			{
				inID = "ID";
			}
			mUserName = inName;
			mUserPic = inPic;
			mUserID = inID;
		}
		public function get userName():String { return mUserName; }
		public function get userID():String { return mUserID; }
		public function get userPic():String { return mUserPic; }
		public function set rank(inRank:int) { mRank = inRank; }
		
		//game stat functions
		public function addST()	{ mST++; }
		public function addFL() { mFL++; }
		public function addFH() { mFH++; }
		public function addFK() { mFK++; }
		public function addSF() { mSF++; }
		public function addDR() { mDR++; }
		
		public function getStatsXML():String
		{
			return "<stats><rank>"+mRank+"</rank><st>"+mST+"</st><fl>"+mFL+"</fl><fh>"+mFH+"</fh><fk>"+mFK+"</fk><sf>"+mSF+"</sf><dr>"+mDR+"</dr></stats>";
		}
		
		public function statsReset()
		{
			mRank = 0;
			mST = 0;
			mFL = 0;
			mFH = 0;
			mFK = 0;
			mSF = 0;
			mDR = 0;
		}
	}
}